package com.proj.customer.controller;

import com.proj.common.bean.Customers;
import com.proj.common.util.ResultData;
import com.proj.customer.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("customers")
public class CustomerController {

    @Autowired
    private CustomerService customerService;

    public ResultData insert(@RequestBody Customers customer){
        Customers data = customerService.insert(customer);
        return ResultData.success(data);
    }

}
